<?php
require_once(dirname(__FILE__) . '/app.php');

$view = "regActiveOk";

$verify_code = strval( $_GET["iid"] );
$verify_length = strlen($verify_code);
if( $verify_length != 32 ){
	//Logs::setLog("verifycode||error--length errror||=".$verify_length);
	include template("regActiveError");
	exit;
}
	
$user = Users::GetUserByVerifyCode($verify_code);

if ( $user && $user['status'] != Users::$STATUS_ACTIVATE){
	Users::ActiveUser($user);
	ZLogin::Login($user['id']);
}else{
	//Logs::setLog("verifycode||error===get-null||=".$verify_code);
	$view = "regActiveError";
}

include template($view);

